﻿//KIKUK BIASA-BIASA LAH .. animax-net.blogspot.com/
var ssBG={
  gbr:[
"http://1.bp.blogspot.com/-GUy5esP8kU0/VOEoO-jjdeI/AAAAAAAAAPY/RRyslYbO3gI/s1600/1.jpg",    
"http://2.bp.blogspot.com/-TUeSVgz27mU/VOEoQ78uXpI/AAAAAAAAAPo/zRPxyXYHfhE/s1600/2.png",
"http://3.bp.blogspot.com/-F7b1umC2WZM/VOEoQ4Ryf9I/AAAAAAAAAPk/b0tJ_eOOKqw/s1600/7.jpg",
"http://1.bp.blogspot.com/-aO9q0W_NKAY/VOEoOgcwXrI/AAAAAAAAAPU/Hp-hvBl_g7Y/s1600/5111%20-%20hatsune_miku%20wallpaper.jpg",
 ],
  now:0,
  SlideMyBG:function(list,style,speed,bgPos,bgSize,bgRep){
    if(!ssBG.SlideMyBG.hasRun){ssBG.SlideMyBG.hasRun=true;
    if(list==null||list==''){list=ssBG.gbr}else{if(typeof list!='object'){list=ssBG.gbr}}
    if(style==null||style==''){style='random'}
    if(speed==null||speed==''){speed=5000}
    if(bgPos==null||bgPos==''){bgPos='top center'}
    if(bgSize==null||bgSize==''){bgSize='100%'}
    if(bgRep==null||bgRep==''){bgRep='repeat'}
    ssBG.gaya=style;ssBG.jeda=speed;ssBG.gbr=list;ssBG.pos=bgPos;ssBG.size=bgSize;ssBG.rep=bgRep;
    ssBG.opt={'background-attachment':'fixed','background-repeat':ssBG.rep,'-moz-background-size':ssBG.size,'background-size':ssBG.size};
    }
    if(ssBG.gaya=='random'){ssBG.gbr=ssBG.gbr.sort(function(){return 0.5-Math.random()})}
    var img=new Image();var brp=ssBG.gbr.length;if(ssBG.now>=brp){ssBG.now=0}
    var gbrSkrng=ssBG.gbr[ssBG.now];ssBG.now++;
    if($('#bg-fader').length==0){$('body').prepend('<div id="bg-fader" style="opacity:0.0;position:fixed;top:0;left:0;width:100%;height:100%;background-color:'+$('body').css('background-color')+'"></div>');$('#bg-fader').css(ssBG.opt);$('body').css(ssBG.opt)}
    $(img).load(function(){
      $('#bg-fader').css({'background-image':'url('+gbrSkrng+')','background-position':ssBG.pos}).animate({opacity:1.0},'slow','linear',function(){
        $('body').css({'background-image':'url('+gbrSkrng+')','background-position':ssBG.pos});
        $(this).animate({opacity:0.0},'slow','linear');
        setTimeout("ssBG.SlideMyBG()",ssBG.jeda);
      });
    }).attr('src',gbrSkrng).error(function(huh){ssBG.SlideMyBG()});
  }
};
